package com.jeesite.modules.kj.file.utils;

import java.io.File;
import java.io.FileOutputStream;

public class FileUtils {
    public static String uploadFile(byte[] file, String path) throws Exception {

        File targetFile = new File(path);
        String a = targetFile.getParent();
        File parentPath = new File(a);
        if(!parentPath.exists()){
            parentPath.mkdirs();
        }
        FileOutputStream out = new FileOutputStream(path);
        out.write(file);
        out.flush();
        out.close();
        return path;
    }

}
